package model

type NoteTab struct {
	Id         *int64  `json:"id"`
	Title      *string `json:"title"`
	Body       *string `json:"body"`
	CategoryId *int64  `json:"category_id"`
	UserId     *int64  `json:"user_id"`
	Ctime      *int64  `json:"ctime"`
	Mtime      *int64  `json:"mtime"`
}

func (NoteTab) TableName() string {
	return "notes_tab"
}

//CREATE TABLE `notes_tab` (
//`id` bigint unsigned NOT NULL AUTO_INCREMENT,
//`title` varchar(255) NOT NULL,
//`body` longtext NOT NULL,
//`category_id` bigint unsigned NOT NULL DEFAULT '4',
//`user_id` int NOT NULL,
//`ctime` bigint DEFAULT NULL COMMENT '创建时间',
//`mtime` bigint DEFAULT NULL COMMENT '修改时间',
//PRIMARY KEY (`id`),
//KEY `idx_notes_ctime` (`ctime`),
//KEY `idx_notes_mtime` (`mtime`),
//KEY `idx_notes_category_id` (`category_id`),
//KEY `idx_notes_user_id` (`user_id`),
//CONSTRAINT `fk_notes_user` FOREIGN KEY (`user_id`) REFERENCES `user_tab` (`id`)
//) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
